 <div class="right_side_operate_area">
	<?php  
		$user=$session->read('User');
		if($showpage==1) {
			if(isset($paging)){ echo $this->renderElement('pagination',$paging);} 
		}
		$isflag = true;
	?>
	<div class="right search_box">
		<form onsubmit="return searchtech()">
	    	<div class="left search_text">
	    		<?php echo $form->text('CompFinacerelease.keyword',array('placeholder'=>'搜索科技金融标题','value'=>$keyword, 'id'=>'finacereleasekey', 'class'=>'text_box'));?>
	    	</div>
	        <div class="left search_btn"><input type="submit" value=""/></div>
        </form>
        <div class="clear"></div>
    </div>
    <div class="right search_box">
		<form onsubmit="return searchtech()">
	    	<div class="left search_text">
	    		<?php echo $form->text('CompFinacerelease.keyword',array('placeholder'=>'搜索企业名称','value'=>$enterprise, 'id'=>'search', 'class'=>'text_box'));?>
	    	</div>
	        <div class="left search_btn"><input type="submit" value=""/></div>
        </form>
        <div class="clear"></div>
    </div>
  	<div class="term_choose_area right">
	    <a class="term_choose_btn" id="term_choose_btn" title="选择"></a>
    	<div class="screen_list" id="screen_list" style="display:none;visibility:hidden;">
    		<ul>
    			<?php 
    			foreach($industrys as $key=>$strindustry){
    				$selected="";
    				if($industry==$key){
    					$selected="selected";
    				}
    				echo '<li class="'.$selected.'">';
    				echo $html->link($strindustry,"javascript:void(0)",array("onclick"=>"return setindustry('".$key."')","class"=>$selected));
    				echo '</li>';
    			}
    			?>
    		</ul>
    		<div id="industry" style="display:none"><?php echo $industry?></div>
    	</div>
    </div>
    <div class="form_sx_drop right">
	<?php
	 if($user['isadmin']||$user['isvisitor']){
		$grouplist=array_merge(array(""=>"请选择模块"),$grouplist);
	    echo $form->select('ddlgroup',$grouplist,$group_mod_id, null,null);
	 }
	 ?>    
	<?php 
		$objyear=$str->getafteryear(1,2008,"请选择发布日期");
    	echo $form->select('ddlyear',$objyear, $year, null,null);
	?>
	</div>
    <div class="clear"></div>
</div>
 

<div class="right_side_scollbar">
	<div class="detail_info_panel">
		<div class="items_list">
			<table>
				<tr>
					<th>企业名称</th>
					<th>模块</th>
					<th>科技金融标题</th>
					<th>金额（元）</th>
					<th>需求</th>
					<th>发布日期</th>
				</tr>
				<?php
	 				foreach($companys as $company){
	 					$id = $company["Company"]["id"];
	 					$company_name = $company["Company"]["company_name"];
	 					$showcname=$html->link($str->sub_len($company_name,20),"/companys/showinfosummary/".$id,array("title"=>$company_name),null);
	 					
	 					$groupname=$grouplist[$company["Company"]["groupid"]];
	 					$objfinaces = $company["CompFinacerelease"];
	 					$objfinacesCount = count($objfinaces);
	 					$i = 0;
 						foreach($objfinaces as $objfinace){
	 						echo "<tr class='per_list'>";
							if($i==0){
								echo "<td rowspan='".$objfinacesCount."'>".$showcname."</td>";
							}
							$title = $objfinace["title"];
							$amount = $objfinace["amount"];
							$requirement = $objfinace["requirement"];
							$time = date("Y-m-d",strtotime($objfinace["modified"]));
							echo "<td>".$html->link($title,"/searchs/showfinacedetail/".$objfinace["id"],null)."</td>";
							echo "<td>".$groupname."</td>";
							echo "<td>".$amount."</td>";
							echo "<td title = '".$requirement."'>".$str->sub_len($requirement,15)."</td>";
							echo "<td>".$time."</td>";
							echo "</tr>";
							$i++;
 						}
 						if($i==0){
							echo "<tr class='per_list'>";
							echo "<td>".$showcname."</td>";
							echo "<td>".$groupname."</td>";
							echo "<td></td><td></td><td></td><td></td>";
							echo "</tr>";
						}
	 				}
    		 	?>
		  </table>
		</div>
	</div>
</div>

<script>
$(document).ready(function() {
	$("#ddlgroup").change(function(){
		searchtech();
		});	
	$("#ddlyear").change(function() {  
		searchtech();
	});
});
if($("#finacereleasekey").val()!=""){
	$("#finacereleasekey").focus();
}
if($("#search").val()!=""){
	$("#search").focus();
}
function setindustry(inid){
	$("#industry").html(inid);
	return searchtech();
}
function searchtech()
{	
	var webpath=$("#getpath").attr('href');
	var urlpath=webpath+"searchs/allfinace?seach=all";
	var group=$("#ddlgroup").val();
	var year=$("#ddlyear").val();
//	var tech=$("#ddltech").val();
//	var state=$("#ddlstate").val();
	var inid=$("#industry").html();
	var finacereleasekey=$("#finacereleasekey").val();
	var search=$("#search").val();
	if(group=="" && year=="" && inid=="" && finacereleasekey=="" &&search==""){
		location.href=urlpath;
	}else{
		if(group!=""){
			urlpath+="&group="+group;
			}		
		if(year!=""){
			urlpath+="&year="+year;
		}
//		if(tech!=""){
//			urlpath+="&tech="+tech;
//		}
//		if(state!=""){
//			urlpath+="&states="+state;
//		}
		if(inid.trim()!=""){
			urlpath+="&industry="+inid.trim();
		}
		if(finacereleasekey.trim()!=""){
			urlpath+="&keyword="+encodeURIComponent(finacereleasekey.trim());
		}
		if(search.trim()!=""){
			urlpath+="&enterprise="+encodeURIComponent(search.trim());
		}
		location.href=urlpath;
	}
	return false;
}
function focuseEV(C,B,A){
	if(window.attachEvent){
		C.attachEvent("on"+B,A);
	}else{
		if(window.addEventListener){
			C.addEventListener(B,A,false);
		}
	}
}
focuseEV(document,"click",function(E){
	var E=E||window.event;
	var A=E.target||E.srcElement;
	var D=window.event?E.button:E.which;
	var C=G("term_choose_btn"),B=G("screen_list");
	while(A&&A!=document.body&&A.tagName.toLowerCase()!="html"){
		if(A==C){break}
		if(A==B){break}
		A=A.parentNode
	}
	if(A==B){
	}else if(A!=C){
		B.style.display="none"
			B.style.visibility="hidden"
	}else{
		if(D<2){
			B.style.display=B.style.display=="block"?"none":"block";
			B.style.visibility=B.style.visibility=="hidden"?"visible":"hidden";
		}
	}
});
funPlaceholder(document.getElementById("finacereleasekey"));
funPlaceholder(document.getElementById("search"));
</script>